"use strict";
var __assign = (this && this.__assign) || Object.assign || function(t) {
    for (var s, i = 1, n = arguments.length; i < n; i++) {
        s = arguments[i];
        for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
            t[p] = s[p];
    }
    return t;
};
Object.defineProperty(exports, "__esModule", { value: true });
require('../../lib/ui');
var common_1 = require("../../share/common");
var openid_1 = require("./modules/openid");
var ReactDOM = require("react-dom");
var React = require("react");
function binding_action(element) {
    var props = {
        title: '绑定微信',
        buttonText: '确定绑定',
        content: {
            normal: "\u786E\u5B9A\u8981\u7ED1\u5B9A\u5FAE\u4FE1\u53F7\u5230" + common_1.shopName + "\u5546\u5BB6\u540E\u53F0\u7CFB\u7EDF\u5417",
            success: '已成功绑定微信号',
            fail: '绑定微信号失败，请重新扫描二维码'
        }
    };
    ReactDOM.render(React.createElement(openid_1.OpenIdPage, __assign({}, props)), element);
}
function adminLogin_action(element) {
    var props = {
        title: '商家登录',
        buttonText: '确定登录',
        content: {
            normal: "\u786E\u5B9A\u8981\u767B\u5F55\u5230" + common_1.shopName + "\u5546\u5BB6\u540E\u53F0\u7CFB\u7EDF\u5417",
            success: '已成功登录',
            fail: '登录号失败，请重新扫描二维码'
        }
    };
    ReactDOM.render(React.createElement(openid_1.OpenIdPage, __assign({}, props)), element);
}
function userLogin_action(element) {
    var props = {
        title: '客户端登录',
        buttonText: '确定登录',
        content: {
            normal: "\u786E\u5B9A\u8981\u767B\u5F55\u5230" + common_1.shopName + "\u5BA2\u6237\u7AEF\u5417",
            success: '已成功登录',
            fail: '登录号失败，请重新扫描二维码'
        }
    };
    ReactDOM.render(React.createElement(openid_1.OpenIdPage, __assign({}, props)), element);
}
function unbinding_action(element) {
    var props = {
        // weixin: page.createService(WeiXinService),
        title: '解绑微信',
        buttonText: '确定解绑',
        content: {
            normal: '确定要解绑微信号吗',
            success: '已成功解绑微信号',
            fail: '解绑失败，请重新扫描二维码'
        }
    };
    ReactDOM.render(React.createElement(openid_1.OpenIdPage, __assign({}, props)), element);
}
var pageElement = document.createElement('div');
document.body.appendChild(pageElement);
switch (location.hash) {
    default:
    case '#index':
        break;
    case '#binding':
        binding_action(pageElement);
        break;
    case '#unbinding':
        unbinding_action(pageElement);
        break;
    case '#adminLogin':
        adminLogin_action(pageElement);
        break;
    case '#userLogin':
        userLogin_action(pageElement);
        break;
}
// define('modules/index', function (mod) {
//     mod.default = (page: chitu.Page) => null
//     return mod
// })
// define('modules/binding', function (mod) {
//     mod.default = binding_action
//     return mod
// })
// define('modules/unbinding', function (mod) {
//     mod.default = unbinding_action
//     return mod
// })
// define('modules/adminLogin', function (mod) {
//     mod.default = adminLogin_action
//     return mod
// })
// define('modules/userLogin', function (mod) {
//     mod.default = userLogin_action
//     return mod
// })
// let app = new Application()
// app.run()
